package lianxi;

import java.util.Scanner;

public class Demo3 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("请输入工作年限:");
        int year = input.nextInt();
        System.out.print("请输入月薪:");
        double money = input.nextDouble();
        double yearmoney = money;

        if (year < 1 && year >= 0) {
            if (money > 8000) {
                yearmoney = money * 1.2;
            }
        } else if (year < 3 && year >= 1) {
            if (money > 15000) {
                yearmoney = money * 3;
            } else {
                yearmoney = money * 2;
            }
        } else if (year >= 3) {
            if (money > 20000) {
                yearmoney = money * 4;
            } else {
                yearmoney = money * 3;
            }
        }

        System.out.println("年终奖为：" + yearmoney);
    }
}
